package com.example.gulimall.search.vo;

import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * <p>
 *      封装查询页面可能传入的参数
 *
 *      ?catalog3Id=255&keyword=小米&sort=saleCount_desc
 * </p>
 *
 * @author zyred
 * @since v 0.1
 **/
@Setter
@Getter
public class SearchParam {

    /** 全文检索 **/
    private String keyword;
    /** 三级分类ID **/
    private Long catalog3Id;
    /*
         排序条件
         sort=saleCount_desc
         sort=skuPrice_desc
         sort=hotScore_desc
    */
    private String sort;
    /*
        是否只显示有货: 0 / 1
    */
    private Integer hasStock;
    /*
        价格区间查询
        skuPrice=1_500 / _500 / 500_
     */
    private String skuPrice;
    /*
     品牌
     &branId=1&branId=2
      */
    private List<Long> brandId;
    /*
        属性筛选
        attrs=1_安卓:IOS&attrs=2_3G:4G
     */
    private List<String> attrs;
    /*
        页码
    */
    private Integer pageNum = 1;
    /*
        原生得查询条件
     */
    private String _queryString;

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
